package com.example.scaffold_demo.mvp.di.user.presenter;


import com.example.httplibrary.mvp.BasePresenter;
import com.example.scaffold_demo.BaseApplication;
import com.example.scaffold_demo.http.ApiService;
import com.example.scaffold_demo.http.ProgressSubcriber;
import com.example.scaffold_demo.http.ServiceGenerator;
import com.example.scaffold_demo.http.reponse.RxHttpReponseCompat;
import com.example.scaffold_demo.mvp.di.user.bean.WelfareHomeUserBean;
import com.example.scaffold_demo.mvp.di.user.contract.WelfareHomeUserContract;

/**
 * Author: 李巷阳
 * Date: 2020/6/9
 * Part:
 * Description:
 */
public class WelfareHomeUserPresenter extends BasePresenter<WelfareHomeUserContract.View> implements WelfareHomeUserContract.Presenter {




    @Override
    public void getUsers(String token) {
        ServiceGenerator.getApiService(ApiService.class).doWelfareHomeUser().compose(RxHttpReponseCompat.<WelfareHomeUserBean>compatResult())
                .subscribe(new ProgressSubcriber<WelfareHomeUserBean>(BaseApplication.getContext(), getView()) {
                    @Override
                    public void onNext(WelfareHomeUserBean loginBean) {
                        getView().onWelfareHomeUserSucceed(loginBean);
                    }
                });;
    }
}
